<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <title>CMS后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link th:replace="resource :: css" rel="stylesheet"/>
</head>
<body>
<div class="container-fluid">
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="javascript:void(0);">内容管理</a>
            </div>
        </div>
    </nav>
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <form class="form-inline" role="form" action="list" method="get">
                <td><input type="text" class="form-control" placeholder="ID" name="id" th:value="${entity.id}"/></td>
                <td><input type="text" class="form-control" placeholder="标题" name="title" th:value="${entity.title}"/></td>
                <td>
                    <select class="form-control" name="channel.id" th:each="e : ${channels}">
                        <option value="">无</option>
                        <option th:value="${e.id}" th:selected="${e.id == entity.channel.id}?true:false" th:text="${e.name}"></option>
                    </select>
                </td>
                <td><input type="text" class="form-control" placeholder="发布日期" name="releaseDate" th:value="${entity.releaseDate}"/></td>
                <td><input type="text" class="form-control" placeholder="发布者" name="author" th:value="${entity.author}"/></td>
                <td><input type="text" class="form-control" placeholder="推荐级别" name="recommendLevel" th:value="${entity.recommendLevel}"/></td>
                <td>
                    <select class="form-control" name="checkState" th:each="e : ${checkStates}">
                        <option value="">全部</option>
                        <option th:value="${e}" th:selected="${e== entity.checkState}?true:false" th:text="${e.name}"></option>
                    </select>
                </td>
                <td>
                    <button type="submit" class="btn btn-primary btn-xs">查询</button>
                    <a type="button" class="btn btn-success btn-xs" href="add">新建</a>
                </td>
            </form>
        </tr>
        <tr>
            <th width="100px">ID</th>
            <th>标题</th>
            <th>栏目</th>
            <th>发布日期</th>
            <th>发布者</th>
            <th>推荐级别</th>
            <th>状态</th>
            <th width="93px">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="entity : ${page.content}">
            <td th:text="${entity.id}"></td>
            <td th:text="${entity.title}"></td>
            <td th:text="${entity.channel.name}"></td>
            <td th:text="${entity.releaseDate}"></td>
            <td th:text="${entity.author}"></td>
            <td th:text="${entity.recommendLevel}"></td>
            <td th:text="${entity.checkState.name}"></td>
            <td>
                <a class="btn btn-success btn-xs" data-id="$!entity.id" href="edit?id=$!entity.id">编辑</a>
                <button type="button" class="btn btn-danger btn-xs remove-item" data-id="$!entity.id">删除</button>
            </td>
        </tr>
        </tbody>
    </table>
    #set($i=$!page.number + 1)
    <ul class="pagination" style="float:right" total="$!page.totalPages" index="$i"></ul>
</div>
<script th:replace="resource :: js"></script>
</body>
</html>
